<%@page language="java" pageEncoding="UTF-8" contentType="text/html;charset=utf-8"%>
<%@include file="/includes/taglibs.jsp"%>



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
            
    <script type="text/javascript">
    <!-- 
    $(document).ready(function() {
    


	$("[id^='radioconfirmType-']").click(function() {
		var confirmType = this.value;
		$('#queryConfirmRule\\.confirmType').val(confirmType);
		
	});

   
    	$('#doSaveConfirmRuleBtn').click(function() {
		
			var checkCount = $('#queryConfirmRule\\.checkCount').val();
    		var confirmCount = $('#queryConfirmRule\\.confirmCount').val();
    		var confirmType = $('#queryConfirmRule\\.confirmType').val();
    		var desKey = $('#queryConfirmRule\\.desKey').val();
    		
    		var errorMessage = '';

				if (checkCount != ''){
					checkCount = checkCount.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
					var intRegex = /^\d+$/;
					
					if(!intRegex.test(checkCount)) {
						errorMessage ='覆核通過門檻必須是整數<br>';	
					  } 
			  				 
				}else {
						errorMessage = '覆核通過門檻不可空白<br>';		
					}	
					
				if (confirmCount != ''){
					value = confirmCount.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
					var intRegex = /^\d+$/;
					if(!intRegex.test(value)) {
						errorMessage ='放行通過門檻必須是整數<br>';						
					}else if(confirmCount==0){
					    errorMessage ='放行通過門檻人數不能為0<br>';
						}
					}else{
						errorMessage = '放行通過門檻不可空白<br>';
					}
					
				
					if (desKey != ''){					
						var desRegex =new RegExp("^[A-Za-z0-9]+$") ;
						if(!desRegex.test(desKey) || desKey.length!=8 ) {
						
						errorMessage ='DES為固定英數字八碼<br>';						
					  	} 		 
					}

    		 if (errorMessage != '')
            	{
                	showErrorMessageDialog(errorMessage);
                	return false;
            	}  
    		return true; 		
		});		
			
	
		<c:if test="${not empty actionBean.message}">
    	showMessageDialog('<c:out value="${actionBean.message }" escapeXml="false"/>');
    	</c:if>
		
 });
 		
    
    function doPrintEvent()
    {
    	divPrint('queryForm');
    	return false;
    }
    
    //-->
    </script>
</head>
<body>

<div id="smallQueryForm"></div>

<stripes:form id="queryUploadFileFrom" beanclass="com.feib.stms.action.Stms9008ActionBean" method="post" onsubmit="javascript: waitingDialog({});">

	<div id="queryForm">
     <table>
			<c:if test="${null != actionBean.queryConfirmRule }">
		    <tr> 
				<td colspan="5" class="queryHeader">請設定券商流程</td>
			</tr>
            <tr>
				<th>覆核通過門檻</th>				
				<td colspan="4"><stripes:text id="queryConfirmRule.checkCount" name="queryConfirmRule.checkCount" size="10" maxlength="10" />人</td>								
			</tr>
			<tr>
				<th>放行通過門檻</th>
				<td colspan="4"><stripes:text id="queryConfirmRule.confirmCount" name="queryConfirmRule.confirmCount" size="10" maxlength="10" />人</td>					
			</tr>
			<tr>
				<th>放行認證方式</th>
				<td>
				 
                	  <label>
                        <input type="radio" name="radioconfirmType"  id="radioconfirmType-<c:out value='${actionBean.queryConfirmRule.confirmType}'/>"  value="0"  <c:if test="${actionBean.queryConfirmRule.confirmType =='0'}">checked="checked" </c:if> />帳號密碼
                      </label>
                      <label>
                        <input type="radio" name="radioconfirmType" id="radioconfirmType-<c:out value='${actionBean.queryConfirmRule.confirmType}'/>"  value="1" <c:if test="${actionBean.queryConfirmRule.confirmType =='1'}">checked="checked" </c:if>/>簽章
                      </label>
                      <label>
                        <input type="radio" name="radioconfirmType" id="radioconfirmType-<c:out value='${actionBean.queryConfirmRule.confirmType}'/>"  value="2" <c:if test="${actionBean.queryConfirmRule.confirmType =='2'}"> checked="checked" </c:if> />簽章+Server認證
                      </label>
                      <stripes:hidden id="queryConfirmRule.confirmType" name="queryConfirmRule.confirmType"/>					
                     
				</td>
	
			</tr>
			<tr>
				<th>DES值</th>
				<td colspan="4"><stripes:text id="queryConfirmRule.desKey" name="queryConfirmRule.desKey" size="8" maxlength="8" /><font color="#FF0000" >DES為固定英數字八碼,空白為上傳檔案不加密</font> </td>					
			</tr>
   			<tr>
					 <td colspan="8" class="listFunction" align="center">
					 <stripes:submit id="doSaveConfirmRuleBtn" name="doSaveConfirmRule" value="確認" class="formBtn"/>			
                      <input type="button" value="列印" onclick="javascript:doPrintEvent();" class="formBtn"/>
                        </td>
                    </tr>
                  
			</c:if>
			
			
			
			
	</table>		
</div>
</stripes:form>		
	

     
     <div id="listForm">         
	</div>



</body>
</html>
